import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from "./store";
import NProgress from 'nprogress'
import plugin from 'plugin'
Vue.use(plugin)
import 'nprogress/nprogress.css'

Vue.directive("limit", (el, data) => {
  let str = el.innerText
  if (str.length > data.value) {
    el.innerText = str.substring(0, data.value) + "..."
  }
})

new Vue({
  store,
  render: h => h(App),
  router,
}).$mount('#app')

router.beforeEach((to, from, next) => {
  document.title = to.meta.title
  NProgress.start();
  next()

});

router.afterEach(() => {
  NProgress.done();
});
